.class public Lcom/glympse/platform/common/HttpJob;
.super Lcom/glympse/platform/common/JobQueue$Job;
.source "HttpJob.java"


# instance fields
.field public m_abPost:[B

.field public m_abResponse:[B

.field public m_fContentLengthMustMatchDownloadSize:Z

.field public m_fPost:Z

.field public m_fReadResponseForFailedCall:Z

.field public m_fSuccess:Z

.field public m_lDuration:J

.field public m_lStartTime:J

.field public m_nContentLen:I

.field public m_nResultCode:I

.field private m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

.field public m_strUrl:Ljava/lang/String;


# direct methods
.method public constructor <init>()V
    .locals 4

    .prologue
    const-wide/16 v2, 0x0

    const/4 v1, 0x0

    const/4 v0, 0x0

    .line 44
    invoke-direct {p0}, Lcom/glympse/platform/common/JobQueue$Job;-><init>()V

    .line 46
    iput-object v1, p0, Lcom/glympse/platform/common/HttpJob;->m_strUrl:Ljava/lang/String;

    .line 47
    iput-boolean v0, p0, Lcom/glympse/platform/common/HttpJob;->m_fPost:Z

    .line 48
    iput-object v1, p0, Lcom/glympse/platform/common/HttpJob;->m_abPost:[B

    .line 49
    iput-object v1, p0, Lcom/glympse/platform/common/HttpJob;->m_abResponse:[B

    .line 50
    iput v0, p0, Lcom/glympse/platform/common/HttpJob;->m_nResultCode:I

    .line 51
    iput v0, p0, Lcom/glympse/platform/common/HttpJob;->m_nContentLen:I

    .line 52
    iput-boolean v0, p0, Lcom/glympse/platform/common/HttpJob;->m_fSuccess:Z

    .line 53
    iput-wide v2, p0, Lcom/glympse/platform/common/HttpJob;->m_lStartTime:J

    .line 54
    iput-wide v2, p0, Lcom/glympse/platform/common/HttpJob;->m_lDuration:J

    .line 55
    iput-boolean v0, p0, Lcom/glympse/platform/common/HttpJob;->m_fReadResponseForFailedCall:Z

    .line 56
    iput-boolean v0, p0, Lcom/glympse/platform/common/HttpJob;->m_fContentLengthMustMatchDownloadSize:Z

    .line 58
    iput-object v1, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

    .line 44
    return-void
.end method


# virtual methods
.method public AddRequestHeaders(Lcom/glympse/platform/GHttpConnection;)V
    .locals 0
    .parameter "oHttpConn"

    .prologue
    .line 222
    return-void
.end method

.method public Clear()V
    .locals 2

    .prologue
    const/4 v1, 0x0

    const/4 v0, 0x0

    .line 63
    iput-object v1, p0, Lcom/glympse/platform/common/HttpJob;->m_strUrl:Ljava/lang/String;

    .line 64
    iput-boolean v0, p0, Lcom/glympse/platform/common/HttpJob;->m_fPost:Z

    .line 65
    iput-object v1, p0, Lcom/glympse/platform/common/HttpJob;->m_abPost:[B

    .line 66
    iput-object v1, p0, Lcom/glympse/platform/common/HttpJob;->m_abResponse:[B

    .line 67
    iput v0, p0, Lcom/glympse/platform/common/HttpJob;->m_nResultCode:I

    .line 68
    iput-boolean v0, p0, Lcom/glympse/platform/common/HttpJob;->m_fSuccess:Z

    .line 69
    const-wide/16 v0, 0x0

    iput-wide v0, p0, Lcom/glympse/platform/common/HttpJob;->m_lStartTime:J

    .line 70
    const-wide/16 v0, -0x1

    iput-wide v0, p0, Lcom/glympse/platform/common/HttpJob;->m_lDuration:J

    .line 71
    return-void
.end method

.method public DumpDownload()V
    .locals 0

    .prologue
    .line 486
    return-void
.end method

.method public DumpUpload()V
    .locals 0

    .prologue
    .line 466
    return-void
.end method

.method public GetPostData()[B
    .locals 1

    .prologue
    .line 431
    iget-object v0, p0, Lcom/glympse/platform/common/HttpJob;->m_abPost:[B

    return-object v0
.end method

.method public GetPostSize()I
    .locals 1

    .prologue
    .line 83
    iget-object v0, p0, Lcom/glympse/platform/common/HttpJob;->m_abPost:[B

    if-nez v0, :cond_0

    const/4 v0, 0x0

    :goto_0
    return v0

    :cond_0
    iget-object v0, p0, Lcom/glympse/platform/common/HttpJob;->m_abPost:[B

    array-length v0, v0

    goto :goto_0
.end method

.method public GetUrl()Ljava/lang/String;
    .locals 1

    .prologue
    .line 210
    iget-object v0, p0, Lcom/glympse/platform/common/HttpJob;->m_strUrl:Ljava/lang/String;

    return-object v0
.end method

.method public IsPost()Z
    .locals 1

    .prologue
    .line 216
    iget-boolean v0, p0, Lcom/glympse/platform/common/HttpJob;->m_fPost:Z

    return v0
.end method

.method public IsSucceeded(I)Z
    .locals 1
    .parameter "nResultCode"

    .prologue
    .line 204
    const/16 v0, 0xc8

    if-ne v0, p1, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public OnAbort()V
    .locals 2

    .prologue
    .line 183
    :try_start_0
    iget-object v1, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

    if-eqz v1, :cond_0

    .line 185
    iget-object v1, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

    invoke-virtual {v1}, Lcom/glympse/platform/GHttpConnection;->Close()V

    .line 186
    const/4 v1, 0x0

    iput-object v1, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 194
    :cond_0
    :goto_0
    return-void

    .line 190
    :catch_0
    move-exception v1

    move-object v0, v1

    .line 192
    .local v0, e:Ljava/lang/Exception;
    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V

    goto :goto_0
.end method

.method public OnProcess()V
    .locals 8

    .prologue
    const/4 v7, 0x0

    .line 89
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v2

    iput-wide v2, p0, Lcom/glympse/platform/common/HttpJob;->m_lStartTime:J

    .line 90
    const-wide/16 v2, -0x1

    iput-wide v2, p0, Lcom/glympse/platform/common/HttpJob;->m_lDuration:J

    .line 95
    :try_start_0
    invoke-virtual {p0}, Lcom/glympse/platform/common/HttpJob;->PreProcess()V

    .line 98
    invoke-virtual {p0}, Lcom/glympse/platform/common/HttpJob;->GetUrl()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Lcom/glympse/platform/GHttpConnection;->Create(Ljava/lang/String;)Lcom/glympse/platform/GHttpConnection;

    move-result-object v2

    iput-object v2, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

    .line 101
    iget-boolean v2, p0, Lcom/glympse/platform/common/HttpJob;->m_fAbort:Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    if-eqz v2, :cond_1

    .line 168
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v2

    iget-wide v4, p0, Lcom/glympse/platform/common/HttpJob;->m_lStartTime:J

    sub-long/2addr v2, v4

    iput-wide v2, p0, Lcom/glympse/platform/common/HttpJob;->m_lDuration:J

    .line 170
    iget-object v2, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

    if-eqz v2, :cond_0

    .line 172
    iget-object v2, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

    invoke-virtual {v2}, Lcom/glympse/platform/GHttpConnection;->Close()V

    .line 173
    iput-object v7, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

    .line 176
    :cond_0
    :goto_0
    return-void

    .line 107
    :cond_1
    :try_start_1
    invoke-virtual {p0}, Lcom/glympse/platform/common/HttpJob;->IsPost()Z

    move-result v1

    .line 110
    .local v1, fPost:Z
    iget-object v2, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

    if-eqz v1, :cond_2

    const/4 v3, 0x1

    :goto_1
    invoke-virtual {v2, v3}, Lcom/glympse/platform/GHttpConnection;->SetRequestMethod(I)V

    .line 113
    iget-object v2, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

    invoke-virtual {p0, v2}, Lcom/glympse/platform/common/HttpJob;->AddRequestHeaders(Lcom/glympse/platform/GHttpConnection;)V

    .line 116
    if-eqz v1, :cond_3

    .line 118
    iget-object v2, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

    invoke-virtual {p0, v2}, Lcom/glympse/platform/common/HttpJob;->SendPost(Lcom/glympse/platform/GHttpConnection;)Z
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    move-result v2

    if-nez v2, :cond_3

    .line 168
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v2

    iget-wide v4, p0, Lcom/glympse/platform/common/HttpJob;->m_lStartTime:J

    sub-long/2addr v2, v4

    iput-wide v2, p0, Lcom/glympse/platform/common/HttpJob;->m_lDuration:J

    .line 170
    iget-object v2, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

    if-eqz v2, :cond_0

    .line 172
    iget-object v2, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

    invoke-virtual {v2}, Lcom/glympse/platform/GHttpConnection;->Close()V

    .line 173
    iput-object v7, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

    goto :goto_0

    .line 110
    :cond_2
    const/4 v3, 0x0

    goto :goto_1

    .line 125
    :cond_3
    :try_start_2
    iget-boolean v2, p0, Lcom/glympse/platform/common/HttpJob;->m_fAbort:Z
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0

    if-eqz v2, :cond_4

    .line 168
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v2

    iget-wide v4, p0, Lcom/glympse/platform/common/HttpJob;->m_lStartTime:J

    sub-long/2addr v2, v4

    iput-wide v2, p0, Lcom/glympse/platform/common/HttpJob;->m_lDuration:J

    .line 170
    iget-object v2, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

    if-eqz v2, :cond_0

    .line 172
    iget-object v2, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

    invoke-virtual {v2}, Lcom/glympse/platform/GHttpConnection;->Close()V

    .line 173
    iput-object v7, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

    goto :goto_0

    .line 131
    :cond_4
    :try_start_3
    iget-object v2, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

    invoke-virtual {v2}, Lcom/glympse/platform/GHttpConnection;->GetResponseCode()I

    move-result v2

    iput v2, p0, Lcom/glympse/platform/common/HttpJob;->m_nResultCode:I

    .line 134
    iget-boolean v2, p0, Lcom/glympse/platform/common/HttpJob;->m_fAbort:Z
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_0

    if-eqz v2, :cond_5

    .line 168
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v2

    iget-wide v4, p0, Lcom/glympse/platform/common/HttpJob;->m_lStartTime:J

    sub-long/2addr v2, v4

    iput-wide v2, p0, Lcom/glympse/platform/common/HttpJob;->m_lDuration:J

    .line 170
    iget-object v2, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

    if-eqz v2, :cond_0

    .line 172
    iget-object v2, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

    invoke-virtual {v2}, Lcom/glympse/platform/GHttpConnection;->Close()V

    .line 173
    iput-object v7, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

    goto :goto_0

    .line 140
    :cond_5
    :try_start_4
    iget-object v2, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

    invoke-virtual {p0, v2}, Lcom/glympse/platform/common/HttpJob;->ProcessResponseHeaders(Lcom/glympse/platform/GHttpConnection;)V

    .line 143
    iget-boolean v2, p0, Lcom/glympse/platform/common/HttpJob;->m_fAbort:Z

    if-nez v2, :cond_6

    iget v2, p0, Lcom/glympse/platform/common/HttpJob;->m_nResultCode:I

    invoke-virtual {p0, v2}, Lcom/glympse/platform/common/HttpJob;->IsSucceeded(I)Z

    move-result v2

    if-nez v2, :cond_7

    iget-boolean v2, p0, Lcom/glympse/platform/common/HttpJob;->m_fReadResponseForFailedCall:Z
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_4 .. :try_end_4} :catch_0

    if-nez v2, :cond_7

    .line 168
    :cond_6
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v2

    iget-wide v4, p0, Lcom/glympse/platform/common/HttpJob;->m_lStartTime:J

    sub-long/2addr v2, v4

    iput-wide v2, p0, Lcom/glympse/platform/common/HttpJob;->m_lDuration:J

    .line 170
    iget-object v2, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

    if-eqz v2, :cond_0

    .line 172
    iget-object v2, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

    invoke-virtual {v2}, Lcom/glympse/platform/GHttpConnection;->Close()V

    .line 173
    iput-object v7, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

    goto/16 :goto_0

    .line 149
    :cond_7
    :try_start_5
    iget-object v2, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

    invoke-virtual {p0, v2}, Lcom/glympse/platform/common/HttpJob;->ReadResponse(Lcom/glympse/platform/GHttpConnection;)Z
    :try_end_5
    .catchall {:try_start_5 .. :try_end_5} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_5 .. :try_end_5} :catch_0

    move-result v2

    if-nez v2, :cond_8

    .line 168
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v2

    iget-wide v4, p0, Lcom/glympse/platform/common/HttpJob;->m_lStartTime:J

    sub-long/2addr v2, v4

    iput-wide v2, p0, Lcom/glympse/platform/common/HttpJob;->m_lDuration:J

    .line 170
    iget-object v2, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

    if-eqz v2, :cond_0

    .line 172
    iget-object v2, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

    invoke-virtual {v2}, Lcom/glympse/platform/GHttpConnection;->Close()V

    .line 173
    iput-object v7, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

    goto/16 :goto_0

    .line 155
    :cond_8
    :try_start_6
    invoke-virtual {p0}, Lcom/glympse/platform/common/HttpJob;->ProcessResponse()V

    .line 158
    iget v2, p0, Lcom/glympse/platform/common/HttpJob;->m_nResultCode:I

    invoke-virtual {p0, v2}, Lcom/glympse/platform/common/HttpJob;->IsSucceeded(I)Z

    move-result v2

    iput-boolean v2, p0, Lcom/glympse/platform/common/HttpJob;->m_fSuccess:Z
    :try_end_6
    .catchall {:try_start_6 .. :try_end_6} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_6 .. :try_end_6} :catch_0

    .line 168
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v2

    iget-wide v4, p0, Lcom/glympse/platform/common/HttpJob;->m_lStartTime:J

    sub-long/2addr v2, v4

    iput-wide v2, p0, Lcom/glympse/platform/common/HttpJob;->m_lDuration:J

    .line 170
    iget-object v2, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

    if-eqz v2, :cond_0

    .line 172
    iget-object v2, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

    invoke-virtual {v2}, Lcom/glympse/platform/GHttpConnection;->Close()V

    .line 173
    iput-object v7, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

    goto/16 :goto_0

    .line 161
    .end local v1           #fPost:Z
    :catch_0
    move-exception v2

    move-object v0, v2

    .line 163
    .local v0, e:Ljava/lang/Exception;
    :try_start_7
    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V
    :try_end_7
    .catchall {:try_start_7 .. :try_end_7} :catchall_0

    .line 168
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v2

    iget-wide v4, p0, Lcom/glympse/platform/common/HttpJob;->m_lStartTime:J

    sub-long/2addr v2, v4

    iput-wide v2, p0, Lcom/glympse/platform/common/HttpJob;->m_lDuration:J

    .line 170
    iget-object v2, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

    if-eqz v2, :cond_0

    .line 172
    iget-object v2, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

    invoke-virtual {v2}, Lcom/glympse/platform/GHttpConnection;->Close()V

    .line 173
    iput-object v7, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

    goto/16 :goto_0

    .line 167
    .end local v0           #e:Ljava/lang/Exception;
    :catchall_0
    move-exception v2

    .line 168
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v3

    iget-wide v5, p0, Lcom/glympse/platform/common/HttpJob;->m_lStartTime:J

    sub-long/2addr v3, v5

    iput-wide v3, p0, Lcom/glympse/platform/common/HttpJob;->m_lDuration:J

    .line 170
    iget-object v3, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

    if-eqz v3, :cond_9

    .line 172
    iget-object v3, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

    invoke-virtual {v3}, Lcom/glympse/platform/GHttpConnection;->Close()V

    .line 173
    iput-object v7, p0, Lcom/glympse/platform/common/HttpJob;->m_oHttpConn:Lcom/glympse/platform/GHttpConnection;

    .line 175
    :cond_9
    throw v2
.end method

.method public PreProcess()V
    .locals 0

    .prologue
    .line 199
    return-void
.end method

.method public ProcessResponse()V
    .locals 0

    .prologue
    .line 426
    return-void
.end method

.method public ProcessResponseHeaders(Lcom/glympse/platform/GHttpConnection;)V
    .locals 0
    .parameter "oHttpConn"

    .prologue
    .line 283
    return-void
.end method

.method public ReadResponse(Lcom/glympse/platform/GHttpConnection;)Z
    .locals 12
    .parameter "oHttpConn"

    .prologue
    const/4 v11, 0x1

    const/4 v10, 0x0

    .line 288
    const/4 v7, 0x0

    .line 294
    .local v7, oHttpRead:Ljava/io/InputStream;
    :try_start_0
    invoke-virtual {p1}, Lcom/glympse/platform/GHttpConnection;->GetContentLength()I

    move-result v3

    .line 295
    .local v3, nLen:I
    iput v3, p0, Lcom/glympse/platform/common/HttpJob;->m_nContentLen:I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_3

    .line 298
    if-nez v3, :cond_1

    .line 406
    if-eqz v7, :cond_0

    .line 410
    :try_start_1
    invoke-virtual {v7}, Ljava/io/InputStream;->close()V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    .line 416
    :goto_0
    const/4 v7, 0x0

    :cond_0
    move v8, v11

    .line 420
    .end local v3           #nLen:I
    :goto_1
    return v8

    .line 412
    .restart local v3       #nLen:I
    :catch_0
    move-exception v1

    .line 414
    .local v1, e:Ljava/lang/Exception;
    invoke-static {v1}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V

    goto :goto_0

    .line 304
    .end local v1           #e:Ljava/lang/Exception;
    :cond_1
    :try_start_2
    invoke-virtual {p1}, Lcom/glympse/platform/GHttpConnection;->OpenInputStream()Ljava/io/InputStream;
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_3

    move-result-object v7

    .line 305
    if-nez v7, :cond_3

    .line 406
    if-eqz v7, :cond_2

    .line 410
    :try_start_3
    invoke-virtual {v7}, Ljava/io/InputStream;->close()V
    :try_end_3
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_1

    .line 416
    :goto_2
    const/4 v7, 0x0

    :cond_2
    move v8, v10

    .line 307
    goto :goto_1

    .line 412
    :catch_1
    move-exception v1

    .line 414
    .restart local v1       #e:Ljava/lang/Exception;
    invoke-static {v1}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V

    goto :goto_2

    .line 323
    .end local v1           #e:Ljava/lang/Exception;
    :cond_3
    :try_start_4
    iget-boolean v8, p0, Lcom/glympse/platform/common/HttpJob;->m_fContentLengthMustMatchDownloadSize:Z

    if-eqz v8, :cond_7

    if-lez v3, :cond_7

    .line 326
    new-array v8, v3, [B

    iput-object v8, p0, Lcom/glympse/platform/common/HttpJob;->m_abResponse:[B
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_4 .. :try_end_4} :catch_3

    .line 328
    const/4 v5, 0x0

    .line 331
    .local v5, nReadOffset:I
    :goto_3
    if-gtz v3, :cond_6

    .line 353
    :cond_4
    if-eqz v3, :cond_8

    .line 406
    if-eqz v7, :cond_5

    .line 410
    :try_start_5
    invoke-virtual {v7}, Ljava/io/InputStream;->close()V
    :try_end_5
    .catch Ljava/lang/Exception; {:try_start_5 .. :try_end_5} :catch_2

    .line 416
    :goto_4
    const/4 v7, 0x0

    :cond_5
    move v8, v10

    .line 355
    goto :goto_1

    .line 334
    :cond_6
    :try_start_6
    iget-object v8, p0, Lcom/glympse/platform/common/HttpJob;->m_abResponse:[B

    invoke-virtual {v7, v8, v5, v3}, Ljava/io/InputStream;->read([BII)I
    :try_end_6
    .catchall {:try_start_6 .. :try_end_6} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_6 .. :try_end_6} :catch_3

    move-result v4

    .line 343
    .local v4, nRead:I
    if-ltz v4, :cond_4

    .line 349
    sub-int/2addr v3, v4

    .line 350
    add-int/2addr v5, v4

    goto :goto_3

    .line 412
    .end local v4           #nRead:I
    :catch_2
    move-exception v1

    .line 414
    .restart local v1       #e:Ljava/lang/Exception;
    invoke-static {v1}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V

    goto :goto_4

    .line 363
    .end local v1           #e:Ljava/lang/Exception;
    .end local v5           #nReadOffset:I
    :cond_7
    :try_start_7
    new-instance v6, Ljava/io/ByteArrayOutputStream;

    invoke-direct {v6}, Ljava/io/ByteArrayOutputStream;-><init>()V

    .line 366
    .local v6, oBuf:Ljava/io/ByteArrayOutputStream;
    const/16 v8, 0x200

    if-gt v3, v8, :cond_a

    const/16 v8, 0x400

    move v2, v8

    .line 369
    .local v2, nBufferSize:I
    :goto_5
    new-array v0, v2, [B

    .line 375
    .local v0, abBlock:[B
    :goto_6
    const/4 v8, 0x0

    array-length v9, v0

    invoke-virtual {v7, v0, v8, v9}, Ljava/io/InputStream;->read([BII)I

    move-result v4

    .line 384
    .restart local v4       #nRead:I
    if-gez v4, :cond_b

    .line 394
    invoke-virtual {v6}, Ljava/io/ByteArrayOutputStream;->toByteArray()[B

    move-result-object v8

    iput-object v8, p0, Lcom/glympse/platform/common/HttpJob;->m_abResponse:[B
    :try_end_7
    .catchall {:try_start_7 .. :try_end_7} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_7 .. :try_end_7} :catch_3

    .line 406
    .end local v0           #abBlock:[B
    .end local v2           #nBufferSize:I
    .end local v4           #nRead:I
    .end local v6           #oBuf:Ljava/io/ByteArrayOutputStream;
    :cond_8
    if-eqz v7, :cond_9

    .line 410
    :try_start_8
    invoke-virtual {v7}, Ljava/io/InputStream;->close()V
    :try_end_8
    .catch Ljava/lang/Exception; {:try_start_8 .. :try_end_8} :catch_6

    .line 416
    :goto_7
    const/4 v7, 0x0

    :cond_9
    move v8, v11

    .line 420
    goto :goto_1

    .line 366
    .restart local v6       #oBuf:Ljava/io/ByteArrayOutputStream;
    :cond_a
    const/16 v8, 0x2000

    mul-int/lit8 v9, v3, 0x2

    :try_start_9
    invoke-static {v8, v9}, Ljava/lang/Math;->min(II)I

    move-result v8

    move v2, v8

    goto :goto_5

    .line 390
    .restart local v0       #abBlock:[B
    .restart local v2       #nBufferSize:I
    .restart local v4       #nRead:I
    :cond_b
    const/4 v8, 0x0

    invoke-virtual {v6, v0, v8, v4}, Ljava/io/ByteArrayOutputStream;->write([BII)V
    :try_end_9
    .catchall {:try_start_9 .. :try_end_9} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_9 .. :try_end_9} :catch_3

    goto :goto_6

    .line 398
    .end local v0           #abBlock:[B
    .end local v2           #nBufferSize:I
    .end local v3           #nLen:I
    .end local v4           #nRead:I
    .end local v6           #oBuf:Ljava/io/ByteArrayOutputStream;
    :catch_3
    move-exception v8

    move-object v1, v8

    .line 400
    .restart local v1       #e:Ljava/lang/Exception;
    :try_start_a
    invoke-static {v1}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V
    :try_end_a
    .catchall {:try_start_a .. :try_end_a} :catchall_0

    .line 406
    if-eqz v7, :cond_c

    .line 410
    :try_start_b
    invoke-virtual {v7}, Ljava/io/InputStream;->close()V
    :try_end_b
    .catch Ljava/lang/Exception; {:try_start_b .. :try_end_b} :catch_4

    .line 416
    :goto_8
    const/4 v7, 0x0

    :cond_c
    move v8, v10

    .line 401
    goto :goto_1

    .line 412
    :catch_4
    move-exception v1

    .line 414
    invoke-static {v1}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V

    goto :goto_8

    .line 405
    .end local v1           #e:Ljava/lang/Exception;
    :catchall_0
    move-exception v8

    .line 406
    if-eqz v7, :cond_d

    .line 410
    :try_start_c
    invoke-virtual {v7}, Ljava/io/InputStream;->close()V
    :try_end_c
    .catch Ljava/lang/Exception; {:try_start_c .. :try_end_c} :catch_5

    .line 416
    :goto_9
    const/4 v7, 0x0

    .line 418
    :cond_d
    throw v8

    .line 412
    :catch_5
    move-exception v1

    .line 414
    .restart local v1       #e:Ljava/lang/Exception;
    invoke-static {v1}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V

    goto :goto_9

    .line 412
    .end local v1           #e:Ljava/lang/Exception;
    .restart local v3       #nLen:I
    :catch_6
    move-exception v1

    .line 414
    .restart local v1       #e:Ljava/lang/Exception;
    invoke-static {v1}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V

    goto :goto_7
.end method

.method public SendPost(Lcom/glympse/platform/GHttpConnection;)Z
    .locals 5
    .parameter "oHttpConn"

    .prologue
    const/4 v4, 0x0

    .line 227
    const/4 v2, 0x0

    .line 231
    .local v2, oHttpWrite:Ljava/io/OutputStream;
    :try_start_0
    invoke-virtual {p0}, Lcom/glympse/platform/common/HttpJob;->GetPostSize()I

    move-result v1

    .line 232
    .local v1, nBytes:I
    if-lez v1, :cond_3

    .line 235
    invoke-virtual {p1, v1}, Lcom/glympse/platform/GHttpConnection;->SetContentLength(I)V

    .line 238
    invoke-virtual {p1}, Lcom/glympse/platform/GHttpConnection;->OpenOutputStream()Ljava/io/OutputStream;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1

    move-result-object v2

    .line 239
    if-nez v2, :cond_2

    .line 263
    :cond_0
    if-eqz v2, :cond_1

    .line 267
    :try_start_1
    invoke-virtual {v2}, Ljava/io/OutputStream;->close()V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    .line 273
    :goto_0
    const/4 v2, 0x0

    :cond_1
    move v3, v4

    .line 277
    .end local v1           #nBytes:I
    :goto_1
    return v3

    .line 269
    .restart local v1       #nBytes:I
    :catch_0
    move-exception v0

    .line 271
    .local v0, e:Ljava/lang/Exception;
    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V

    goto :goto_0

    .line 245
    .end local v0           #e:Ljava/lang/Exception;
    :cond_2
    :try_start_2
    invoke-virtual {p0, v2}, Lcom/glympse/platform/common/HttpJob;->WritePostData(Ljava/io/OutputStream;)Z

    move-result v3

    if-eqz v3, :cond_0

    .line 251
    invoke-virtual {v2}, Ljava/io/OutputStream;->flush()V
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_1

    .line 263
    :cond_3
    if-eqz v2, :cond_4

    .line 267
    :try_start_3
    invoke-virtual {v2}, Ljava/io/OutputStream;->close()V
    :try_end_3
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_4

    .line 273
    :goto_2
    const/4 v2, 0x0

    .line 277
    :cond_4
    const/4 v3, 0x1

    goto :goto_1

    .line 255
    .end local v1           #nBytes:I
    :catch_1
    move-exception v3

    move-object v0, v3

    .line 257
    .restart local v0       #e:Ljava/lang/Exception;
    :try_start_4
    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_0

    .line 263
    if-eqz v2, :cond_5

    .line 267
    :try_start_5
    invoke-virtual {v2}, Ljava/io/OutputStream;->close()V
    :try_end_5
    .catch Ljava/lang/Exception; {:try_start_5 .. :try_end_5} :catch_2

    .line 273
    :goto_3
    const/4 v2, 0x0

    :cond_5
    move v3, v4

    .line 258
    goto :goto_1

    .line 269
    :catch_2
    move-exception v0

    .line 271
    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V

    goto :goto_3

    .line 262
    .end local v0           #e:Ljava/lang/Exception;
    :catchall_0
    move-exception v3

    .line 263
    if-eqz v2, :cond_6

    .line 267
    :try_start_6
    invoke-virtual {v2}, Ljava/io/OutputStream;->close()V
    :try_end_6
    .catch Ljava/lang/Exception; {:try_start_6 .. :try_end_6} :catch_3

    .line 273
    :goto_4
    const/4 v2, 0x0

    .line 275
    :cond_6
    throw v3

    .line 269
    :catch_3
    move-exception v0

    .line 271
    .restart local v0       #e:Ljava/lang/Exception;
    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V

    goto :goto_4

    .line 269
    .end local v0           #e:Ljava/lang/Exception;
    .restart local v1       #nBytes:I
    :catch_4
    move-exception v0

    .line 271
    .restart local v0       #e:Ljava/lang/Exception;
    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V

    goto :goto_2
.end method

.method public SetPostData([B)V
    .locals 1
    .parameter "abPost"

    .prologue
    .line 76
    iput-object p1, p0, Lcom/glympse/platform/common/HttpJob;->m_abPost:[B

    .line 77
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/glympse/platform/common/HttpJob;->m_fPost:Z

    .line 78
    return-void
.end method

.method public WritePostData(Ljava/io/OutputStream;)Z
    .locals 5
    .parameter "oHttpWrite"

    .prologue
    const/4 v4, 0x0

    .line 437
    invoke-virtual {p0}, Lcom/glympse/platform/common/HttpJob;->GetPostData()[B

    move-result-object v0

    .line 440
    .local v0, abPost:[B
    if-eqz v0, :cond_0

    array-length v2, v0

    if-lez v2, :cond_0

    .line 444
    const/4 v2, 0x0

    :try_start_0
    array-length v3, v0

    invoke-virtual {p1, v0, v2, v3}, Ljava/io/OutputStream;->write([BII)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 453
    :cond_0
    const/4 v2, 0x1

    :goto_0
    return v2

    .line 446
    :catch_0
    move-exception v2

    move-object v1, v2

    .line 448
    .local v1, e:Ljava/lang/Exception;
    invoke-static {v1}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V

    move v2, v4

    .line 449
    goto :goto_0
.end method
